home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1996 February / EnigmA AMIGA RUN 04 (1996)(G.R. Edizioni)(IT)[!][issue 1996-02][Skylink CD III].iso / earcd / comm2 / termsorc.lha / Extras / Source / gtlayout-source.lha / LTP_AddHistory.c < prev    next >
C/C++ Source or Header  |  1995-09-24  |  993b  |  39 lines

  1. /*  GadTools layout toolkit
  2. **
  3. **  Copyright © 1993-1995 by Olaf `Olsen' Barthel
  4. **  Freely distributable.
  5. */
  6.  
  7. #include "gtlayout_global.h"
  8.  
  9. VOID __regargs
  10. LTP_AddHistory(struct SGWork *Work)
  11. {
  12.     ObjectNode *Node;
  13.  
  14.     if(GETOBJECT(Work -> Gadget,Node))
  15.     {
  16.         if(Node -> Special . String . HistoryHook)
  17.         {
  18.             struct MinList *List = Node -> Special . String . HistoryHook -> h_Data;
  19.  
  20.             while(Node -> Special . String . NumHistoryLines >= Node -> Special . String . MaxHistoryLines)
  21.             {
  22.                 CallHookPkt(Node -> Special . String . HistoryHook,Work -> Gadget,NULL);
  23.  
  24.                 Node -> Special . String . NumHistoryLines--;
  25.             }
  26.  
  27.             Work -> WorkBuffer[Work -> NumChars] = 0;
  28.  
  29.             if(CallHookPkt(Node -> Special . String . HistoryHook,Work -> Gadget,Work -> WorkBuffer))
  30.                 Node -> Special . String . NumHistoryLines++;
  31.  
  32.             if(List -> mlh_Head -> mln_Succ)
  33.                 Node -> Special . String . CurrentNode = (struct Node *)List -> mlh_TailPred;
  34.             else
  35.                 Node -> Special . String . CurrentNode = NULL;
  36.         }
  37.     }
  38. }
  39.